# -*- coding: utf-8 -*-
"""
-------------------------------------------------
   File Name：     decorate
   Description : 装饰器类方法
   Author :       zm.z
   date：          2020/2/3
-------------------------------------------------
   Change Activity:
                   2020/2/3:
-------------------------------------------------
"""
__author__ = 'zm.z'
from tmall.proporties.rdb import ToolRedis

rdb = ToolRedis()

def saveFuncExit(func):
    def wrapper(*args, **kwargs):
        key = "exit:%s" % func.__name__
        # if rdb.get(key):
        #     return None

        resp = func(*args, **kwargs)
        rdb.set_with_today("exit:%s" % func.__name__)
        return resp
    return wrapper

@saveFuncExit
def test1():
    return 1

if __name__ == '__main__':
    test1()